package xin.mashibo.pattern.factorymethod;

/**
 * 工厂抽象类
 *
 * @author MaShibo
 * 日期 :  2019/1/22
 */
public abstract class Factory {

    public final Product create(String owner) {
        Product product = createProduct(owner);
        registerProduct(product);
        return product;
    }

    protected abstract Product createProduct(String owner);

    protected abstract void registerProduct(Product product);

}
